package com.yzw.phonestoreservice.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 商品表
 * @TableName phone_info
 */
@TableName(value ="phone_info")
@Data
public class PhoneInfo implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer phoneId;

    /**
     * 商品名称
     */
    private String phoneName;

    /**
     * 商品单价
     */
    private BigDecimal phonePrice;

    /**
     * 描述
     */
    private String phoneDescription;

    /**
     * 库存
     */
    private Integer phoneStock;

    /**
     * 小图
     */
    private String phoneIcon;

    /**
     * 类目编号
     */
    private Integer categoryType;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;

    /**
     * 标签
     */
    private String phoneTag;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PhoneInfo other = (PhoneInfo) that;
        return (this.getPhoneId() == null ? other.getPhoneId() == null : this.getPhoneId().equals(other.getPhoneId()))
            && (this.getPhoneName() == null ? other.getPhoneName() == null : this.getPhoneName().equals(other.getPhoneName()))
            && (this.getPhonePrice() == null ? other.getPhonePrice() == null : this.getPhonePrice().equals(other.getPhonePrice()))
            && (this.getPhoneDescription() == null ? other.getPhoneDescription() == null : this.getPhoneDescription().equals(other.getPhoneDescription()))
            && (this.getPhoneStock() == null ? other.getPhoneStock() == null : this.getPhoneStock().equals(other.getPhoneStock()))
            && (this.getPhoneIcon() == null ? other.getPhoneIcon() == null : this.getPhoneIcon().equals(other.getPhoneIcon()))
            && (this.getCategoryType() == null ? other.getCategoryType() == null : this.getCategoryType().equals(other.getCategoryType()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getPhoneTag() == null ? other.getPhoneTag() == null : this.getPhoneTag().equals(other.getPhoneTag()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPhoneId() == null) ? 0 : getPhoneId().hashCode());
        result = prime * result + ((getPhoneName() == null) ? 0 : getPhoneName().hashCode());
        result = prime * result + ((getPhonePrice() == null) ? 0 : getPhonePrice().hashCode());
        result = prime * result + ((getPhoneDescription() == null) ? 0 : getPhoneDescription().hashCode());
        result = prime * result + ((getPhoneStock() == null) ? 0 : getPhoneStock().hashCode());
        result = prime * result + ((getPhoneIcon() == null) ? 0 : getPhoneIcon().hashCode());
        result = prime * result + ((getCategoryType() == null) ? 0 : getCategoryType().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getPhoneTag() == null) ? 0 : getPhoneTag().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", phoneId=").append(phoneId);
        sb.append(", phoneName=").append(phoneName);
        sb.append(", phonePrice=").append(phonePrice);
        sb.append(", phoneDescription=").append(phoneDescription);
        sb.append(", phoneStock=").append(phoneStock);
        sb.append(", phoneIcon=").append(phoneIcon);
        sb.append(", categoryType=").append(categoryType);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", phoneTag=").append(phoneTag);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}